package com.glsc.ngateway.common.xir.repo;

import com.glsc.ngateway.common.xir.domain.VrptAccSecuAll;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface VrptAccSecuAllRepository extends JpaRepository<VrptAccSecuAll, Void>, JpaSpecificationExecutor<VrptAccSecuAll> {

    @Query(value = "select * from XIR_TRD.VRPT_ACC_SECU_ALL t where 1=1 " +
            "and (:account is null or t.VC_PORT_NAME_1  like CONCAT(:account, '%'))" +
            "", nativeQuery = true)
    List<VrptAccSecuAll> findAllByVcPortNameLike(@Param("account") String account);
}